@font-face {
    font-family: 'Square721BT';
    src: url('../font/Square721BT.otf') format('opentype');
}

.player-box-grid {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px;
    z-index: 1000;

    // 演示模式切换按钮
    .demo-toggle {
        position: absolute;
        top: -40px;
        right: 10px;
        background: rgba(255, 165, 0, 0.8);
        color: white;
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 14px;
        cursor: pointer;
        user-select: none;
        z-index: 1010;
        border: 2px solid #ff8c00;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        
        &:hover {
            background: rgba(255, 140, 0, 0.9);
            border-color: #e07600;
        }
    }

    .column {
        width: 330px; // 增加宽度以容纳更多内容

        .scroll-container {
            position: relative;
            height: 380px; // 固定高度：个玩家 * (60px + 8px gap) - 8px
            overflow: hidden;

            .players-wrapper {
                gap: 8px;
                transition: transform 0.5s ease-in-out;
                position: relative;

                &.fast-reset {
                    transition: transform 0.3s ease-out;
                }
                
                // 虚拟滚动支持
                .virtual-player {
                    &.player-cell {
                        box-sizing: border-box;
                    }
                }

                .player-cell {
                    position: relative;
                    color: white;
                    flex-shrink: 0;
                    margin-bottom: 8px;
                    
                    &:last-child {
                        margin-bottom: 0;
                    }

                    .avatar {
                        border-radius: 10px;
                        object-fit: cover;
                        flex-shrink: 0;
                    }

                    .avatar-frame {
                        position: absolute;
                        top: 8px;
                        left: -4px;
                        z-index: 1000;
                    }

                    .rank-box {
                        position: absolute;
                        bottom: 14px;
                        left: 6px;
                        scale: 0.8;
                    }

                    .rank-text {
                        position: absolute;
                        bottom: 21px;
                        left: 12px;
                        font-size: 10px;
                        font-family: 'Square721BT';
                        color: #fff;
                        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 
                                     1px 1px 2px rgba(0, 0, 0, 0.6),
                                     0 0 8px rgba(255, 255, 255, 0.3);
                        filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5));
                    }

                    .badge {
                        display: flex;
                        align-items: center;
                        padding: 0 2px;
                        border-radius: 3px;
                        opacity: 0.8;
                        min-width: 90px;
                        flex-shrink: 0;
                        justify-self: start; // 在grid中左对齐

                        img {
                            height: 30px;
                            width: 27px;
                        }

                        span {
                            font-size: 13px;
                            color: #fff;
                            margin-left: 4px;
                            text-align: left;
                            white-space: pre;
                        }
                    }

                    .info {
                        margin-left: 15px;
                        font-family: 'Arial';

                        .player-name {
                            font-weight: bold;
                            white-space: nowrap;
                            overflow: hidden;
                            text-overflow: ellipsis;
                        }

                        .stats-row {
                            display: grid;
                            grid-template-columns: 1fr 1fr;
                            align-items: center;
                            margin-bottom: 2px;
                            gap: 8px;
                            
                            .stat {
                                display: flex;
                                align-items: center;
                                text-align: left;
                                min-width: 0;
                                position: relative;

                                .label {
                                    margin-right: 4px;
                                    white-space: nowrap;
                                }

                                .value {
                                    white-space: nowrap;
                                }

                                .military-float {
                                    position: absolute;
                                    left: 50%;
                                    bottom: 0;
                                    transform: translate(-50%, 0);
                                    color: #ffe38f;
                                    font-weight: bold;
                                    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
                                    opacity: 0;
                                    animation: militaryFloatUp 1.2s ease-out forwards;
                                    pointer-events: none;
                                    font-size: 15px;
                                    
                                    &.is-positive {
                                        color: #5dff9c;
                                    }

                                    &.is-negative {
                                        color: #ff5f5f;
                                    }
                                }
                            }
                        }

                        .progress-bar-container {
                            width: 100%;
                            height: 6px;
                            background-color: rgba(0, 0, 0, 0.3);
                            border-radius: 3px;
                            margin-top: 0;
                            overflow: hidden;
                            box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
                        }

                        .progress-bar-fill {
                            height: 100%;
                            border-radius: 3px;
                            transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
                            background: white;
                        }

                        .progress-row {
                            display: flex;
                            align-items: center;
                            gap: 6px;
                            margin-top: 4px;

                            .progress-bar-container {
                                margin-top: 0;
                            }

                        }

                    }

                    .progress-like-gif {
                        position: absolute;
                        object-fit: contain;
                        pointer-events: none;
                    }
                }
            }
        }
    }
}

@keyframes militaryFloatUp {
    0% {
        transform: translate(-50%, 0);
        opacity: 0;
    }

    15% {
        transform: translate(-50%, -6px);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -30px);
        opacity: 0;
    }
}
